//
//  PKDetailBaseViewController.m
//  PianKe
//
//  Created by lanou on 15/10/14.
//  Copyright (c) 2015年 李伟伟. All rights reserved.
//

#import "PKDetailBaseViewController.h"

@interface PKDetailBaseViewController ()
@property(nonatomic, strong)UIButton *backButton;
@end



@implementation PKDetailBaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view addSubview:self.topView];
}

-(UIView *)topView
{
    if (!_topView) {
        _topView = [[UIView alloc]initWithFrame:CGRectMake(0, 20, SCREEN_HEIGHT, 50)];
        _topView.backgroundColor = [UIColor grayColor];
        _backButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _backButton.frame = CGRectMake(12, 18, 20, 20);
        _backButton.backgroundColor = [UIColor grayColor];
        [_backButton setImage:[UIImage imageNamed:@"后退"] forState:UIControlStateNormal];
        [_backButton addTarget:self action:@selector(backToReadMainView) forControlEvents:UIControlEventTouchUpInside];
        [_topView addSubview:_backButton];
        [_topView addSubview:self.titleLabel];
        
    }
    return _topView;
    
    
}
-(UILabel *)titleLabel
{
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(50, 10, 200, 30)];
    }
    return _titleLabel;
}



-(void)backToReadMainView
{
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
